#!/usr/bin/python3.5
# -*- coding utf-8
from app import db
from flask_login import UserMixin


class User(db.Model, UserMixin):
    __tablename__ = 'p_user'
    id = db.Column(db.Integer, autoincrement=True, primary_key=True)
    user_name = db.Column(db.String(120))
    phone = db.Column(db.String(11))
    login_error_num = db.Column(db.Integer)
    login_ip = db.Column(db.String(18))
    last_login_date = db.Column(db.DateTime)
    modify_date = db.Column(db.DateTime)
    create_date = db.Column(db.DateTime)

class Channel(db.Model):
    __tablename__ = 'p_channels'
    id = db.Column(db.Integer, autoincrement=True, primary_key=True, )
    developer_id = db.Column(db.Integer)
    channel = db.Column(db.String(150))

    def __repr__(self):
        return '<Channel %r>' % self.channel
